<style>
#content .info-contact span.error {
    color: #FF0000;
	clear:none;
    margin-left: 5px;
	float:left;
	font-weight:500;
	padding-top: 4px;
}
.required {
    color: #FF0000;
	font-weight:500;
}

</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
    // this will run when page is loaded and scrip above is already processed
    window.onload = function(){
        // we create a map 
        <?php
        $user_id = UtilHelp::get_user_id_subdomain();
        if ($user_id != 0) {
        ?>
            var centerPoint = new google.maps.LatLng(<?php echo $contactinfo->lat!=''?$contactinfo->lat:'51.87052'; ?>,<?php echo $contactinfo->lon!=''?$contactinfo->lon:'4.59228'; ?>);
        <?php
        }
        else {
        ?>
            var centerPoint = new google.maps.LatLng(51.87052,4.59228);
        <?php
        }
        ?>
        
        var myOptions = {
            zoom: 17,
            center: centerPoint,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        var map = new google.maps.Map(document.getElementById("map-div"), myOptions);
 
        // we create draggable marker of the user's location
        /*var myLocationMarker = new google.maps.Marker({draggable:true});
        myLocationMarker.setPosition(centerPoint);
        google.maps.event.addListener(myLocationMarker, 'dragend', function(event) {
            // closure is called when draggin ends
            alert(this.getPosition());
        });
        myLocationMarker.setAnimation(google.maps.Animation.DROP);
        myLocationMarker.setMap(map);*/
 
        // create clikable marker with custom data
        /*var destinationMarker = new google.maps.Marker({
            clickable:true,
            position:new google.maps.LatLng(51.87077,4.59516)
        });
        destinationMarker.someCustomData = 'Pontifex';
        google.maps.event.addListener(destinationMarker, 'click', function(event) {
            alert(this.someCustomData);
        });
        destinationMarker.setMap(map);*/
 
        // finally create a marker with custom icons and hover handlers <?php echo base_url(); ?>assets/images/logo.png
        var imagUrls = {
            <?php
            if ($user_id != 0) {
            ?>  
                oneOn: '<?php echo $contactinfo->logo_name!=''?$this->config->item('link-assets').$this->config->item('upload_folder_banner').$contactinfo->logo_name:base_url().'assets/images/logo_map.png'; ?>',
                oneOff: '<?php echo $contactinfo->logo_name!=''?$this->config->item('link-assets').$this->config->item('upload_folder_banner').$contactinfo->logo_name:base_url().'assets/images/logo_map.png'; ?>'
            <?php
            }
            else {
            ?>
                oneOn: '<?php echo base_url(); ?>assets/images/logo_map.png',
                oneOff: '<?php echo base_url(); ?>assets/images/logo_map.png'
            <?php
            }
            ?>
        };
        var images = {
            oneOn: new google.maps.MarkerImage(imagUrls.oneOn),
            oneOff: new google.maps.MarkerImage(imagUrls.oneOff)
        };
        var ferryMarker = new google.maps.Marker({
            clickable:true,
            <?php
            if ($user_id != 0) {
            ?>
                position:new google.maps.LatLng(<?php echo $contactinfo->lat!=''?$contactinfo->lat:'51.87052'; ?>, <?php echo $contactinfo->lon!=''?$contactinfo->lon:'4.59228'; ?>),
            <?php
            }
            else {
            ?>
                position:new google.maps.LatLng(51.87052, 4.59228),
            <?php
            }
            ?>
            
            icon:images.oneOff,
			title:"<?php if ($user_id != 0 && $contactinfo->address != '') { echo $contactinfo->address; } else { echo 'Rembrandtweg 257 2981 CZ RIDDERKERK';} ?>"
        });
        google.maps.event.addListener(ferryMarker, 'mouseover', function(event) {
            this.setIcon(images.oneOn);
        });
        google.maps.event.addListener(ferryMarker, 'mouseout', function(event) {
            this.setIcon(images.oneOff);
        });
        ferryMarker.setMap(map);
    }
</script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/jscripts/jquery.validate.js"></script>
<script type="text/javascript">
$().ready(function() {
	// validate signup form on keyup and submit
	$("#frm_contact").validate({
		rules: {
			fullname: "required",
			captcha_code: "required",
            email: {
				required: true,
				email: true
			},
			phone: {
				number: true,
				minlength:5
			},      
            message: "required"
		},
		messages: {
			fullname: "<?php echo lang('PLEASE INPUT FULLNAME'); ?>",
			captcha_code: "<?php echo lang('PLEASE INPUT CODE'); ?>",
            email: "<?php echo lang('PLEASE INPUT EMAIL'); ?>",
			phone: "<?php echo lang('PLEASE INPUT PHONE'); ?>",
            message: "<?php echo lang('PLEASE INPUT MESSAGE'); ?>"
		}
	});	
});
</script>
<?php
	  $fullname   = '';
	  $email      = '';
	  $phone        = '';
	  $company    = '';
	  $content    = '';
	  if ($this->session->flashdata('sent_error')!='') 
	  {
		  $fullname = $this->session->flashdata('fullname');
		  $email = $this->session->flashdata('email');
		  $phone = $this->session->flashdata('phone');
		  $company = $this->session->flashdata('company');
		  $content = $this->session->flashdata('content');
	  }
?>
        <div class="main-banner">
                <div class="right" id="container">
                	<div id="example">
                        <div id="slides">
                            <div class="slides_container"> 
                             <?php
							if(count($slideshows))
							{
								foreach($slideshows as $item)
								{
							?>
                                <a href="#"><img src="<?php echo $this->config->item('link-assets').$this->config->item('upload_folder_banner').$item['image']; ?>" width="665" height="166" alt="" /></a>
							<?php
                                }
                            }
                            ?>     
                            </div>
                            <div class="bg-left"></div>
                            <div class="bg-right"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div id="main-container">
        	<div class="main-left">
            	<div class="block">
            <h3>Meer weten?</h3>
            <p>Wilt u meer weten over de BMA Academy? Neem dan contact met ons op. U kunt gebruik maken van het contactformulier op deze pagina, of ons benaderen via mail, telefoon of social media</p>
                 </div>
                 <div class="block service">
                 	<h3><a href="#">Diensten:</a></h3>
                    <ul class="list">
                    	 <a href="<?php echo site_url('opleidingstraject'); ?>">Opleidingstraject</a></li>
                        <a href="<?php echo site_url('bedrijven'); ?>">Bedrijven</a></li>
                        <a href="<?php echo site_url('jongeren'); ?>">Jongeren</a></li>
                        <a href="<?php echo site_url('re-integratie'); ?>">Re-integratie</a></li>
                    </ul>
                 </div>
            </div>
            <div class="main-right">
                <?php
                echo form_open('contact/send','name="frm_contact" id="frm_contact"');
                ?>
            	<h1>Contact</h1>
                <div class="block1">
                	<h4 style="width:650px" class="title"><?php echo lang('COMPANY INFORMATION'); ?></h4>
                    <div style="line-height:30px"><strong>Adres:</strong> <?php if ($user_id != 0) { echo $contactinfo->address; } else { echo 'Rembrandtweg 257, 2981 CZ Ridderkerk';} ?></div>
                    <div class="contact">
                    	<strong>Tel:</strong> <?php if ($user_id != 0) { echo $contactinfo->phone; } else { echo '0180-420199';} ?><br />
                        <strong>KvK nr.:</strong> <?php if ($user_id != 0) { echo $contactinfo->kvk; } else { echo '24352459';} ?>
                    </div>
                    <div class="contact">
                    	<strong>Fax:</strong> <?php if ($user_id != 0) { echo $contactinfo->fax; } else { echo '0180-420199';} ?><br />
                        <strong>BTW nr.:</strong> <?php if ($user_id != 0) { echo $contactinfo->btw; } else { echo 'NL 8123.68.836.B01';} ?>
                    </div>
                    <div class="contact">
                    	<strong>Email:</strong> <a style="color:#0C356A" href="mailto:<?php if ($user_id != 0) { echo $contactinfo->email; } else { echo 'info@bma-academy.nl';} ?>"><?php if ($user_id != 0) { echo $contactinfo->email; } else { echo 'info@bma-academy.nl';} ?></a><br />
                    	<strong>Volg ons op:</strong>
                        <?php
                        if ($user_id == 0) {
                        ?>
                        <a href="http://www.facebook.com/lerenzonderschool"><img src="<?php echo base_url(); ?>assets/images/icon-facebook.png" width="16" height="16" /></a>
                    	<a href="http://www.twitter.com/bma_academy">
                        <img src="<?php echo base_url(); ?>assets/images/icon-twitter.png" width="16" height="16" />
                        </a>
                    	<a href="http://www.linkedin.com/company/2536883?trk=tyah">
                        <img src="<?php echo base_url(); ?>assets/images/icon-link.png" width="16" height="16" />
                        </a>
                        <?php
                        }
                        else {
                        ?>
                        <a href="<?php echo strpos($contactinfo->facebook_link,'http')===false?'http://'.$contactinfo->facebook_link:$contactinfo->facebook_link; ?>"><img src="<?php echo base_url(); ?>assets/images/icon-facebook.png" width="16" height="16" /></a>
                    	<a href="<?php echo strpos($contactinfo->twitter_link,'http')===false?'http://'.$contactinfo->twitter_link:$contactinfo->twitter_link; ?>">
                        <img src="<?php echo base_url(); ?>assets/images/icon-twitter.png" width="16" height="16" />
                        </a>
                    	<a href="<?php echo strpos($contactinfo->linkln_link,'http')===false?'http://'.$contactinfo->linkln_link:$contactinfo->linkln_link; ?>">
                        <img src="<?php echo base_url(); ?>assets/images/icon-link.png" width="16" height="16" />
                        </a>
                        <?php   
                        }
                        ?>
                        
					</div>
                </div>
                
                <div class="block1">
                	<h4 style="width:650px" class="title"><?php echo lang('CONTACT LOCATION'); ?></h4>
                    <div class="contact-map"><div id="map-div" style="width:600px; height:400px"></div></div>
                </div>
                
                <div class="block1">
                	<h4 class="title"><?php echo lang('CONTACT FORM TAB'); ?></h4>
                    <?php
        				if($this->session->flashdata('error')!='')
    					{
    						echo "<div class='alert'><i>".$this->session->flashdata('error')."</i></div>";	
    					}
        				if($this->session->flashdata('result')!='')
    					{
    						echo "<div class='success'>".$this->session->flashdata('result')."</div>";	
    					}
    				?>
                    <p style="padding:10px 0">Bent u geïnteresseerd in één van onze diensten of heeft u een vraag? Neem dan contact met ons op.</p>
                    <ul>
                        
                        	<label><?php echo lang('FULLNAME'); ?>(<b class="required">*</b>):</label>
                            <input type="text" style="float:left"  name="fullname" id="fullname" value="<?php echo $fullname; ?>" />
                        </li>
                        
                        	<label><?php echo lang('EMAIL'); ?>(<b class="required">*</b>):</label>
                            <input type="text" style="float:left"   name="email" id="email" value="<?php echo $email; ?>"  />
                        </li>
                        
                        	<label><?php echo lang('PHONE'); ?>:</label>
                            <input type="text" style="float:left"   name="phone" id="phone" value="<?php echo $phone; ?>"  />
                        </li>
                        
                        	<label><?php echo lang('COMPANY'); ?>:</label>
                            <input type="text" style="float:left"   name="company" id="company" value="<?php echo $company; ?>"  />
                        </li>
                        
                        	<label><?php echo lang('MESSAGE'); ?>(<b class="required">*</b>):</label>
                            <textarea name="message" style="float:left"   id="message" ><?php echo $content; ?></textarea>
                        </li>
                        
                        	<label>&nbsp;</label>
                            <img id="captcha" style="padding-top:5px" src="<?php echo base_url(); ?>assets/securimage/securimage_show.php" alt="CAPTCHA Image" align="absmiddle" />
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onclick="document.getElementById('captcha').src = '<?php echo base_url(); ?>assets/securimage/securimage_show.php?' + Math.random(); return false">[ <?php echo lang('REFRESH'); ?> ]</a>
    
                        </li>
                        
                        	<label><?php echo lang('CODEABOVE'); ?>(<b class="required">*</b>):</label>
                            <input type="text" style="float:left" name="captcha_code"  id="captcha_code" />
                        </li>
                    </ul>
                    
                </div>
                
                
                
                <div class="block1">
                    <ul>
                        
                            <input class="button" type="submit" value="<?php echo lang('T_SEND'); ?>" name="" />
                        </li>
                    </ul>
            	</div>
                </form>
            </div>            
        </div>
        
        <?php
            $this->load->view('common/social_footer_tpl.php');
        ?>
<script>
jQuery(document).ready(function(){
	jQuery("#mcontact").addClass('active');
});
</script>